<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Store Manager | Manage your Store and Product</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- CSS -->
    <link href="<?php echo base_url();?>assets/css/bootstrap.css" rel="stylesheet">
    <style type="text/css">

      /* Sticky footer styles
      -------------------------------------------------- */
      html,
      body {
        height: 100%;
        /* The html and body elements cannot have any padding or margin. */
      }

      /* Wrapper for page content to push down footer */
      #wrap {
        min-height: 100%;
        height: auto !important;
        height: 100%;
        /* Negative indent footer by it's height */
        margin: 0 auto -60px;
      }

      /* Set the fixed height of the footer here */
      #push,
      #footer {
        height: 60px;
      }
      #footer {
        background-color: #f5f5f5;
      }

      /* Lastly, apply responsive CSS fixes as necessary */
      @media (max-width: 767px) {
        #footer {
          margin-left: -20px;
          margin-right: -20px;
          padding-left: 20px;
          padding-right: 20px;
        }
      }

      /* Custom page CSS
      -------------------------------------------------- */
      /* Not required for template or sticky footer method. */

      #wrap > .container {
        padding-top: 60px;
      }
      .container .credit {
        margin: 20px 0;
      }
      code {
        font-size: 80%;
      }
      
      .form-signin {
        max-width: 400px;
        padding: 19px 29px 29px;
        margin: 20px auto;
        background-color: #fff;
        border: 1px solid #e5e5e5;
        -webkit-border-radius: 5px;
           -moz-border-radius: 5px;
                border-radius: 5px;
        -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
           -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
                box-shadow: 0 1px 2px rgba(0,0,0,.05);
      }
      .form-signin .form-signin-heading,
      .form-signin .checkbox {
        margin-bottom: 10px;
      }
      .form-signin input[type="text"],
      .form-signin input[type="password"] {
        font-size: 16px;
        height: auto;
      }
      hr { 
		  margin:0;
		  
		}

    </style>
    <link href="<?php echo base_url();?>assets/css/bootstrap-responsive.css" rel="stylesheet">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="<?php echo base_url();?>assets/js/html5shiv.js"></script>
    <![endif]-->

    <!-- Fav and touch icons -->
    <link rel="shortcut icon" href="<?php echo base_url();?>assets/image/icon.png">
    
  </head>

  <body>


    <!-- Part 1: Wrap all page content here -->
    <div id="wrap">

      <!-- Fixed navbar -->
      <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="navbar-inner">
          <div class="container">
            <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <a class="brand" href="#">Store Manager</a>
            <div class="nav-collapse collapse">
              <!--<ul class="nav navbar-form pull-right">
                <li><a href="#">Home</a></li>
                <li><a href="<?php echo site_url('auth/register');?>">Register</a></li>
              </ul>-->
            </div><!--/.nav-collapse -->
          </div>
        </div>
      </div>

      <!-- Begin page content -->
		<div class="container">
			<div class="form-signin">
				
			<h2 class="form-signin-heading">Register Account</h2>
			
			<?php
			if ($use_username) {
				$username = array(
					'name'	=> 'username',
					'id'	=> 'username',
					'value' => set_value('username'),
					'maxlength'	=> $this->config->item('username_max_length', 'tank_auth'),
					'size'	=> 30,
					'class' => 'input-block-level',
				);
			}
			$email = array(
				'name'	=> 'email',
				'id'	=> 'email',
				'value'	=> set_value('email'),
				'maxlength'	=> 80,
				'size'	=> 30,
				'class' => 'input-block-level',
			);
			$password = array(
				'name'	=> 'password',
				'id'	=> 'password',
				'value' => set_value('password'),
				'maxlength'	=> $this->config->item('password_max_length', 'tank_auth'),
				'size'	=> 30,				
				'class' => 'input-block-level',
			);
			$confirm_password = array(
				'name'	=> 'confirm_password',
				'id'	=> 'confirm_password',
				'value' => set_value('confirm_password'),
				'maxlength'	=> $this->config->item('password_max_length', 'tank_auth'),
				'size'	=> 30,
				'class' => 'input-block-level',
			);
			$captcha = array(
				'name'	=> 'captcha',
				'id'	=> 'captcha',
				'maxlength'	=> 8,
			);
			$store_name = array(
				'name'	=> 'store_name',
				'id'	=> 'store_name',
				'value'	=> set_value('store_name'),
				'maxlength'	=> 80,
				'size'	=> 30,
				'class' => 'input-block-level',
			);
			?>
			
			<?php echo form_open($this->uri->uri_string(),'id="signup-form"'); ?>			
			
				<?php if ($use_username) { ?>
			
					<?php echo form_label('Username <span style="color: red;">*</span>', $username['id']); ?>
					<?php echo form_input($username); ?>
					<?php echo form_error($username['name']); ?>
					
					<?php echo isset($errors[$username['name']])? '<span style="color:#E91510">'.$errors[$username['name']].'</span>' : '' ; ?>
					<hr>
						
					
				<?php } ?>				
				
				<?php echo form_label('Email Address <span style="color: red;">*</span>', $email['id']); ?>
				<?php echo form_input($email); ?>
				<?php echo form_error($email['name']); ?>
				<?php echo isset($errors[$email['name']])? '<span style="color:#E91510">'.$errors[$email['name']].'</span>' : ''; ?>
				<hr>
					
				<?php echo form_label('Password <span style="color: red;">*</span>', $password['id']); ?>
				<?php echo form_password($password); ?>
				<?php echo form_error($password['name']); ?>
				<hr>	
					
				<?php echo form_label('Confirm Password <span style="color: red;">*</span>', $confirm_password['id']); ?>
				<?php echo form_password($confirm_password); ?>
				<?php echo form_error($confirm_password['name']); ?>

				<?php if ($captcha_registration) {
					if ($use_recaptcha) { ?>
				
						<div id="recaptcha_image"></div>
					
						<a href="javascript:Recaptcha.reload()">Get another CAPTCHA</a>
						<div class="recaptcha_only_if_image"><a href="javascript:Recaptcha.switch_type('audio')">Get an audio CAPTCHA</a></div>
						<div class="recaptcha_only_if_audio"><a href="javascript:Recaptcha.switch_type('image')">Get an image CAPTCHA</a></div>
					
						<div class="recaptcha_only_if_image">Enter the words above</div>
						<div class="recaptcha_only_if_audio">Enter the numbers you hear</div>
					
						<input type="text" id="recaptcha_response_field" name="recaptcha_response_field" />
						<span style="color: red; margin:5px 0; display:block;">
							<?php echo form_error('recaptcha_response_field'); ?>
						</span>
					
					<?php echo $recaptcha_html; ?>
				
				<?php } else { ?>
				
						<p>Enter the code exactly as it appears:</p>
						<?php echo $captcha_html; ?>
					
						<?php echo form_label('Confirmation Code', $captcha['id']); ?>
						<?php echo form_input($captcha); ?>
						<?php echo form_error($captcha['name']); ?>
						<hr>
				<?php }
				} ?>
				
			<h2 class="form-signin-heading">Your Store</h2>
			
			<?php echo form_label('Store Name <span style="color: red;">*</span>', $store_name['id']); ?>
			<?php echo form_input($store_name); ?>
			<?php echo form_error($store_name['name']); ?>
			<?php echo isset($errors[$store_name['name']])? '<span style="color:#E91510">'.$errors[$store_name['name']].'</span>' : ''; ?>
			
			
			<p><?php echo form_submit('register', 'Register', 'class="btn btn-primary" type="submit"'); ?></p>
			
			<span style="float:right"> 
				<i class="icon-arrow-left"></i> <a href="<?php echo base_url('auth/login'); ?>"> Back to Login </a>
			</span>
			
			<?php echo form_close(); ?>
			</div>
		</div>

		<div id="push"></div>
	</div>

    <div id="footer">
      <div class="container">
        <p class="muted credit">Copyright &copy; 2013 <a href="#">Commerce</a></p>
      </div>
    </div>
    

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="<?php echo base_url();?>assets/js/jquery.1.9.1.js"></script>
    <script src="<?php echo base_url();?>assets/js/bootstrap-transition.js"></script>
    <script src="<?php echo base_url();?>assets/js/bootstrap-alert.js"></script>
    <script src="<?php echo base_url();?>assets/js/bootstrap-modal.js"></script>
    <script src="<?php echo base_url();?>assets/js/bootstrap-dropdown.js"></script>
    <script src="<?php echo base_url();?>assets/js/bootstrap-scrollspy.js"></script>
    <script src="<?php echo base_url();?>assets/js/bootstrap-tab.js"></script>
    <script src="<?php echo base_url();?>assets/js/bootstrap-tooltip.js"></script>
    <script src="<?php echo base_url();?>assets/js/bootstrap-popover.js"></script>
    <script src="<?php echo base_url();?>assets/js/bootstrap-button.js"></script>
    <script src="<?php echo base_url();?>assets/js/bootstrap-collapse.js"></script>
    <script src="<?php echo base_url();?>assets/js/bootstrap-typeahead.js"></script>
    
    <script src="<?php echo base_url();?>assets/js/jquery.validate.js"></script>
    
    <script type="text/javascript">
		$("#signup-form").validate({
                rules: {
                    username: "required",
                    email: {
                        required: true,
                        email: true
                    },
                    password: {
                        required: true,
                        minlength: 8
                    },
                    confirm_password: {
                        required: true,
                        minlength: 8
                    },
                    captcha: "required",
                    store_name:{
						required: true
					}
                },
                messages: {
                    name: "Name is required!",
                    password: {
                        required: "Password is required!",
                        minlength: "Your password must be at least 8 characters long"
                    },
                    email: "Please enter a valid email address",
                    confirm_password: "Please enter Your password",
                    store_name: "Store Name is required!",
                },
                submitHandler: function(form) {					
                    form.submit();
                }
            });
            
            <?php if (isset($errors[$username['name']])){ ?>
				$("#username").removeClass('valid');
				$("#username").addClass('error');
			<?php }?>
            
            <?php if (isset($errors[$email['name']])){ ?>
				$("#email").removeClass('valid');
				$("#email").addClass('error');
			<?php }?>
	</script>

  </body>
</html>
